package cn.sharp.bbs.service.impl;

import cn.sharp.bbs.service.CacheService;
import org.springframework.cache.annotation.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

/**
 * @author zhao yu
 */
@Service
@Transactional
@CacheConfig
public class CacheServiceImpl implements CacheService {

    @Override
    @CachePut(value = "MessSseEmitter", key = "#key")
    public SseEmitter saveMessSseEmitter(Long key, SseEmitter sseEmitter) {
        return sseEmitter;
    }

    @Override
    @Cacheable(value = "MessSseEmitter", key = "#key")
    public SseEmitter findMessSseEmitter(Long key) {
        return null;
    }

    @Override
    @CacheEvict(value = "MessSseEmitter", key = "#key")
    public void clearMessSseEmitter(Long key) {
    }
}
